package com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@FeignClient(value = "sayHelloServiceProvider")
interface FeignClientTool
{
	@RequestMapping(method = RequestMethod.GET, value = "/hello/{name}")
	String sayHelloInClient(@RequestParam("name") String name);
}

 
@RestController
public class Controller {
		
	@Autowired
	private FeignClientTool tool;
	
	@RequestMapping(value = "/callHello", method = RequestMethod.GET)
	public String callHello() {
		return tool.sayHelloInClient("Peter");
	}
	
	
	
	
}
